<template>
    <div class="home">
        <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
            <van-swipe-item>1</van-swipe-item>
            <van-swipe-item>2</van-swipe-item>
            <van-swipe-item>3</van-swipe-item>
            <van-swipe-item>4</van-swipe-item>
        </van-swipe>
        <div class="main">
            <div class="box" v-for="(v,i) in list" :key="i">
                <img :src="v.img" alt />
                <p>{{ v.title }}</p>
            </div>
        </div>
    </div>
</template>

<script>
import axios from "axios"
export default {
    name: 'home',

    data() {
        return {
            list: []
        };
    },

    mounted() {

    },

    methods: {

    },

    created() {
        axios.post("/list").then(res => {
            console.log(res.data);
            this.list = res.data.data
        })
    }
};
</script>

<style lang="scss" scoped>
.my-swipe .van-swipe-item {
    color: #fff;
    font-size: 20px;
    line-height: 150px;
    text-align: center;
    background-color: #39a9ed;
}
.main{
    width: 100%;
    height: 200px;
    display: flex;
    flex-wrap: wrap;
    .box{
        width: 25%;
        height: 100px;
    }
}
</style>